<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>查看</title>
    <link href="../../layuiadmin/js/adm/css/bootstrap.css" rel="stylesheet">
    <script src="../../layuiadmin/js/adm/js/vue.js"></script>
    <script src="../../layuiadmin/js/adm/js/vue-resource.js"></script>
    <script src="../../layuiadmin/js/adm/js/jquery.min.js"></script>
    <script src="../../layuiadmin/js/adm/js/bootstrap.js"></script>
    <script src="../../layuiadmin/js/adm/js/getUrlParam.js"></script>
</head>
<style>
    td{
        padding-left: 15px;
    }
    span{
        color: darkgray
    }

</style>
<body>
    <div id="app" >
            
            <table border="1px" style="width: 100%;height: 400px;border: none" >
               <tr>
                    <td style="width: 33%">
                        <span>日志类型：</span><br>
                        {{logtable.typeId.logStairName}}
                    </td>
                    <td style="width: 33%">
                         <span>详细类别：</span><br>
                        {{logtable.logSecondId.logStairName}}
                    </td>
                    <td style="width: 33%">
                         <span>归属人</span><br>
                        {{logtable.userId.userName}}
                    </td>
               </tr>
               <tr>
                    <td>
                         <span>公开状态</span><br>
                        <p v-if="logtable.state=='Y'">已公开</p>
                        <p v-if="logtable.state=='N'">未公开</p>
                    </td>
                    <td>
                         <span>案件：</span><br>
                        {{logtable.caseId.caseId}}
                    </td>
                    <td>
                         <span>客户名称：</span><br>
                        {{logtable.caseId.clientId.clientName}}
                    </td>
                </tr>
                <tr>
                    <td>
                         <span>起始时间：</span><br>
                        {{logtable.startTime|formatDate}}至
                        {{logtable.entTime|formatDate}}
                    </td>
                    <td>
                         <span>自报时长：</span><br>
                        {{logtable.duration}}
                    </td>
                    <td>
                         <span>更新时间：</span><br>
                        {{logtable.udpatetime|formatDate}}
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                         <span>备注：</span><br>
                        {{logtable.description}}
                    </td>
                </tr>
            </table>
    </div>
    

    <script>
          var vm=new Vue({
            el:'#app',
            data:{
                logtable:{
                    logId:"",
                    userId:{
                        userName:""
                    },
                    typeId:{
                        logStairName:""
                    },
                    logSecondId:{
                        logStairName:""
                    },
                    state:"",
                    caseId:{
                        caseId:"",
                        clientId:{
                            clientName:""
                        }
                    },
                    startTime:"",
                    entTime:"",
                    duration:"",
                    udpatetime:"",
                    uploading:"",
                    description:""
                }
            },  
            methods: {
                postcx(id){
                    this.$http.post('http://localhost:8080/log_table/examine',{"id":id},{emulateJSON:true}).then(result =>{
                        var dat=eval("("+result.body+")")
                        this.logtable=dat
                    })
                }
            },
            created () {
                var id = getUrlParam("id")
                this.postcx(id);
            },
            filters: {
                formatDate: function (value) {      //将时间戳修改为时间单位格式
                    let date = new Date(value);
                    let y = date.getFullYear();
                    let MM = date.getMonth() + 1;
                    MM = MM < 10 ? ('0' + MM) : MM;
                    let d = date.getDate();
                    d = d < 10 ? ('0' + d) : d;
                    let h = date.getHours();
                    h = h < 10 ? ('0' + h) : h;
                    let m = date.getMinutes();
                    m = m < 10 ? ('0' + m) : m;
                    let s = date.getSeconds();
                    s = s < 10 ? ('0' + s) : s;
                    return y + '-' + MM + '-' + d ;
                   // return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
                }
            },
        })      
    </script>

</body>
</html>